/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package projetofinal2;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import ComMestre.Mestre;
import java.sql.SQLException;
/**
 *
 * @author Du
 */
public class ProjetoFinal2 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException, ClassNotFoundException, SQLException {
        Mestre mestre = new Mestre(Integer.parseInt(args[0]));

        while (true) {
            System.out.println("Servidor aguardando conexao...");
            ServerSocket me = mestre.getServSocket();
            Socket sock = me.accept();
            mestre.setconNo(sock);

            Thread t = new Thread(mestre);
            t.start();
        }


    }
}
